package com.hbnu.entity;

public class Word {
    private int id;
    private String word;
    private String phonetic;
    private String definition;
    private String example;

    public Word() {}
    public Word(int id, String word, String phonetic, String definition, String example) {
        this.id = id;
        this.word = word;
        this.phonetic = phonetic;
        this.definition = definition;
        this.example = example;
    }

    // getter和setter
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public String getWord() { return word; }
    public void setWord(String word) { this.word = word; }
    public String getPhonetic() { return phonetic; }
    public void setPhonetic(String phonetic) { this.phonetic = phonetic; }
    public String getDefinition() { return definition; }
    public void setDefinition(String definition) { this.definition = definition; }
    public String getExample() { return example; }
    public void setExample(String example) { this.example = example; }
    @Override
    public String toString() {
        return "单词: " + word + "\n" +
                "音标: " + phonetic + "\n" +
                "释义: " + definition + "\n" +
                "例句: " + example;
    }
}